#ifndef __CORE_SINGLETONMANAGER_H__
#define __CORE_SINGLETONMANAGER_H__

#include "singletonbase.h"

#include <boost/make_shared.hpp> //WTF

#include <vector>

namespace boost {
   template<typename T>
   class shared_ptr;
}

namespace raytracer {

template<typename SingletonType>
class Singleton;

class SingletonManager : public SingletonBase
                       , private std::vector< boost::shared_ptr<SingletonBase> >
{
   SINGLETON_ONLYDEF(SingletonManager);

public:

   template<typename SingletonType>
   void m_register_instance(boost::shared_ptr<SingletonType>);

   static SingletonManager& instance();

private:

   static boost::shared_ptr<SingletonManager> __singleton_manager;
};

} //end of namespace

#include "singletonmanager.hxx"

#endif //__CORE_SINGLETONMANAGER_H__

